﻿using CefSharp.WinForms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace xCloud
{
    public class chromeWrap
    {
        ChromiumWebBrowser _webbrowser = null;
        public void LoadWebPage(Panel parent, string url)
        {
            if (_webbrowser != null && parent.Controls.Contains(_webbrowser))
            {
                parent.Controls.Remove(_webbrowser);
            }
            _webbrowser = null;
            _webbrowser = new ChromiumWebBrowser(url)
            { Dock = DockStyle.Fill };
            parent.Controls.Add(_webbrowser);
            _webbrowser.Dock = DockStyle.Fill;
        }
    }
}
